<template>
	<view class="listBox">
		<view class="bg-white u-margin-bottom-30 u-flex padding list" v-for="(item,index) in list" :key="index">
			<view v-if="check">
				<u-checkbox active-color="#ff7348" shape="circle" v-model="item.checked"></u-checkbox>
			</view>
			<view class="u-flex-1" style="overflow: hidden;">
				<view class="u-flex u-margin-bottom-20">
					<view class="u-flex-1" style="overflow: hidden;">
						<view class="u-line-1 title">
							萨拉的咖啡就爱上了对方萨拉的咖啡就爱上了对方
						</view>
						<view class="u-line-1 u-margin-top-20">
							<u-tag text="日用百货" color="#ff7348" bg-color="#ffeee7" border-color="transparent"
								type="success" />
						</view>
						<view class="u-font-24 u-margin-top-20">
							<view class="u-margin-bottom-10">{{$t("电话")}}</view>
							<view class="u-line-1 color-999">109938475847</view>
						</view>
					</view>
					<image class="image u-margin-left-10" :src='serverImageUrl("/static/images/index/huangji.png")'>
					</image>
				</view>
				<u-line color="#cccccc" />
				<view class="u-flex information u-margin-top-20 u-row-between">
					<view class="color-999 u-line-1 u-flex-1 address">
						<image :src='serverImageUrl("/static/images/com/customerListBySearchResult/address.png")'>
						</image>
						中国，哈尔滨市，葫芦岛，定远舰中国，哈尔滨市，葫芦岛，定远舰中国，哈尔滨市，葫芦岛，定远舰
					</view>
					<view>
						<u-button v-if="showAddBfBtn" @click="$emit('addVisit',item)" type="primary" :custom-style="customStyle1"
							hover-class="none">
							{{$t("添加拜访")}}
						</u-button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			check: {
				type: Boolean,
				default: false,
			},
			list: {
				type: Array,
				default: [],
				required: true,
			},
			showAddBfBtn: {
				type: Boolean,
				default: false,
			}
		},
		data() {
			return {
				customStyle1: {
					background: 'transparent',
					'border-radius': '35rpx',
					border: '1rpx solid #ff4a17',
					color: '#ff4a17',
					'min-width': '180rpx',
					'font-size': '26rpx',
					height: '55rpx',
				},
			};
		},
		methods: {}
	}
</script>

<style lang="scss" scoped>
	.listBox {

		.padding {
			padding: 20rpx 30rpx;
		}

		.color-999 {
			color: #999;
		}

		.bg-white {
			background: #fff;
		}

		.list {
			border-radius: 15rpx;

			.information {
				font-size: 22rpx;

				&>view {
					overflow: hidden;
				}
			}

			.address {
				color: #999999;
				font-size: 24rpx;

				image {
					width: 30rpx;
					height: 30rpx;
					margin-right: 10rpx;
					vertical-align: middle;
					transform: translateY(-2px);
				}
			}

			.image {
				width: 200rpx;
				height: 200rpx;
				border-radius: 30rpx;
			}
		}
	}
</style>